package com.glsc.ngateway.common.base.repo.mysql.gateway.other;

import com.glsc.ngateway.common.base.domain.mysql.gateway.other.TradeSeatFlowSpeed;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TradeSeatFlowSpeedRepository extends JpaRepository<TradeSeatFlowSpeed, Integer>, JpaSpecificationExecutor<TradeSeatFlowSpeed> {

    @Query(value = "select t.* from t_am_trade_seat_flow_speed t where t.trade_seat_code in :tradeSeatCode  ", nativeQuery = true)
    List<TradeSeatFlowSpeed> listByTradeSeatCode(List<String> tradeSeatCode);

    @Query(value = "update t_am_trade_seat_flow_speed t set t.status=0 where t.trade_seat_code in :tradeSeatCode  ", nativeQuery = true)
    @Modifying
    int deleteByTradeSeatCode(List<String> tradeSeatCode);
}
